class PsynergiesController < ApplicationController
  # GET /psynergies
  # GET /psynergies.xml
  def index
    @psynergies = Psynergy.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @psynergies }
    end
  end

  # GET /psynergies/1
  # GET /psynergies/1.xml
  def show
    @psynergy = Psynergy.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @psynergy }
    end
  end

  # GET /psynergies/new
  # GET /psynergies/new.xml
  def new
    @psynergy = Psynergy.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @psynergy }
    end
  end

  # GET /psynergies/1/edit
  def edit
    @psynergy = Psynergy.find(params[:id])
  end

  # POST /psynergies
  # POST /psynergies.xml
  def create
    @psynergy = Psynergy.new(params[:psynergy])

    respond_to do |format|
      if @psynergy.save
        flash[:notice] = 'Psynergy was successfully created.'
        format.html { redirect_to(@psynergy) }
        format.xml  { render :xml => @psynergy, :status => :created, :location => @psynergy }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @psynergy.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /psynergies/1
  # PUT /psynergies/1.xml
  def update
    @psynergy = Psynergy.find(params[:id])

    respond_to do |format|
      if @psynergy.update_attributes(params[:psynergy])
        flash[:notice] = 'Psynergy was successfully updated.'
        format.html { redirect_to(@psynergy) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @psynergy.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /psynergies/1
  # DELETE /psynergies/1.xml
  def destroy
    @psynergy = Psynergy.find(params[:id])
    @psynergy.destroy

    respond_to do |format|
      format.html { redirect_to(psynergies_url) }
      format.xml  { head :ok }
    end
  end
end
